package com.weichen.xd.data;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Dune on 2017/9/11.
 */

public class Now implements Parcelable {

    public static final Creator<Now> CREATOR = new Creator<Now>() {
        @Override
        public Now createFromParcel(Parcel source) {
            return new Now(source);
        }

        @Override
        public Now[] newArray(int size) {
            return new Now[size];
        }
    };
    /**
     * cond : {"code":"100","txt":"晴"}
     * fl : 26
     * hum : 78
     * <p>
     * pcpn : 0
     * pres : 1010
     * tmp : 25
     * vis : 7
     * wind : {"deg":"174","dir":"南风","sc":"3-4","spd":"13"}
     */

    @SerializedName("cond")
    private Cond cond;
    @SerializedName("fl")
    private String fl;
    @SerializedName("hum")
    private String hum;
    @SerializedName("pcpn")
    private String pcpn;
    @SerializedName("pres")
    private String pres;
    @SerializedName("tmp")
    private String tmp;
    @SerializedName("vis")
    private String vis;
    @SerializedName("wind")
    private Wind wind;

    public Now() {
    }

    protected Now(Parcel in) {
        this.cond = in.readParcelable(Cond.class.getClassLoader());
        this.fl = in.readString();
        this.hum = in.readString();
        this.pcpn = in.readString();
        this.pres = in.readString();
        this.tmp = in.readString();
        this.vis = in.readString();
        this.wind = in.readParcelable(Wind.class.getClassLoader());
    }

    public Cond getCond() {

        return cond;
    }

    public void setCond(Cond cond) {
        this.cond = cond;
    }

    public String getFl() {
        return fl;
    }

    public void setFl(String fl) {
        this.fl = fl;
    }

    public String getHum() {
        return hum;
    }

    public void setHum(String hum) {
        this.hum = hum;
    }

    public String getPcpn() {
        return pcpn;
    }

    public void setPcpn(String pcpn) {
        this.pcpn = pcpn;
    }

    public String getPres() {
        return pres;
    }

    public void setPres(String pres) {
        this.pres = pres;
    }

    public String getTmp() {
        return tmp;
    }

    public void setTmp(String tmp) {
        this.tmp = tmp;
    }

    public String getVis() {
        return vis;
    }

    public void setVis(String vis) {
        this.vis = vis;
    }

    public Wind getWind() {
        return wind;
    }

    public void setWind(Wind wind) {
        this.wind = wind;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.cond, flags);
        dest.writeString(this.fl);
        dest.writeString(this.hum);
        dest.writeString(this.pcpn);
        dest.writeString(this.pres);
        dest.writeString(this.tmp);
        dest.writeString(this.vis);
        dest.writeParcelable(this.wind, flags);
    }
}
